#===============================================================================
# Copyright 2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#===============================================================================

#++
#  Math backend (MKL) definitions for makefile
#--
HMLDIR:= $(if $(wildcard $(DIR)/__deps/hml/*),$(DIR)/__deps/hml,                            \
                $(if $(wildcard $(HMLROOT)/include/*),$(subst \,/,$(HMLROOT)),                              \
                    $(error Can`t find Hygon BLAS libs in $(DIR)/__deps/hml or HMLROOT.)))
HMLDIR.include := $(HMLDIR)/include
HMLDIR.libia   := $(HMLDIR)/lib

daaldep.lnx32e.hml.thr := $(HMLDIR.libia)/libhblas.$a  $(HMLDIR.libia)/libhlapack_lp64.$a
daaldep.lnx32e.hml.seq := $(HMLDIR.libia)/libhblas.$a  $(HMLDIR.libia)/libhlapack_lp64.$a

daaldep.math_backend.thr := $(daaldep.lnx32e.hml.thr)
daaldep.math_backend.seq := $(daaldep.lnx32e.hml.seq)
daaldep.math_backend.ext := $(daaldep.lnx32e.hml.seq)
daaldep.math_backend.sycl := $(daaldep.lnx32e.hml.thr)
daaldep.math_backend.oneapi := $(daaldep.lnx32e.hml.thr)

daaldep.math_backend.incdir := $(HMLDIR.include)
daaldep.math_backend_oneapi.incdir := $(HMLDIR.include)

# List of HML libraries to exclude from linking.
# This list is used to generate the `--exclude-libs` linker options.
# If you need to exclude additional libraries, extend this list by appending the library names.
MATH_LIBS_TO_EXCLUDE := libhblas.$a libhlapack_lp64.$a


